﻿namespace EyeOpen.Data.Nibernate.Mapping
{
    using EyeOpen.Domain;

    public abstract class HistoryMap<T> : UniqueEntityMap<T> where T : HistoryEntity<T>, new()
    {
        protected HistoryMap()                                             
        {
            Map(x => x.Version)
                .Not.Nullable()
                .CustomSqlTypeIs("timestamp");

            References(x => x.Previous)
                .NotFound.Exception()
                .ColumnName("PreviousId");
        }
    }
}